//
//  MenuView.h
//  PopMenuTableView
//
//  Created by LoadingMx on 2017/9/18.
//  Copyright © 2017年 LoadingMx. All rights reserved.
//

#import <UIKit/UIKit.h>


/**
 MenuModel
 */
@interface MenuModel : NSObject

@property (nonatomic, copy) NSString *imageName;
@property (nonatomic, copy) NSString *itemName;

+ (instancetype)MenuModelWithDict:(NSDictionary *)dict;

@end


/**
 MenuTableViewCell
 */
@interface MenuTableViewCell : UITableViewCell

@property (nonatomic, strong) MenuModel *model;

@end


/**
 动态菜单栏
 */
typedef void(^ItemClickBlock)(NSString *str, NSInteger tag);
typedef void(^BackViewTapBlock)();

@interface MenuView : UIView

@property (nonatomic, copy) ItemClickBlock itemsClickBlock;
@property (nonatomic, copy) BackViewTapBlock backViewTapBlock;

@property (nonatomic, assign) NSInteger maxValueForItemCount;


/**
 Menu 动态菜单

 @param frame frame
 @param target 将在哪个控制器弹出
 @param dataArray 菜单项内容
 @param itemsClickBlock 点击菜单项回调
 @param backViewTapBlock 点击背景遮罩的回调
 @return MenuView 创建的对象
 */
+ (MenuView *)createMenuWithFrame:(CGRect)frame target:(UIViewController *)target dataArray:(NSArray *)dataArray itemsClickBlock:(void(^)(NSString *str, NSInteger tag))itemsClickBlock backViewTap:(void(^)())backViewTapBlock;


/**
 隐藏菜单
 */
+ (void)hidden;

/**
 移除菜单
 */
+ (void)clearMenu;

/**
 指定位置, 展示菜单

 @param point 坐标
 */
+ (void)showMenuAtPoint:(CGPoint)point;

/**
 追加菜单项

 @param appendItemsArray 需要追加的菜单项内容数组
 */
+ (void)appendMenuItemsWith:(NSArray *)appendItemsArray;

/**
 更新菜单项

 @param newItemArray 需要更新的菜单项内容数组
 */
+ (void)updateMenuItemsWith:(NSArray *)newItemArray;

@end



